//
//  JSTInterestcircleImageFrame.m
//  KYKJPackDemo
//
//  Created by 01 on 17/5/10.
//  Copyright © 2017年 ???. All rights reserved.
//

#import "JSTInterestcircleImageFrame.h"
#import "JSTInterestcircleDataModel.h"

@implementation JSTInterestcircleImageFrame

- (void)setModel:(JSTInterestcircleDataModel *)model
{
    _model = model;
    
    // 评论带图片时的图片Frame
    [model.contentImgUrlArr enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop)
     {
         UIImageView *imgView = [[UIImageView alloc] init];
         imgView.tag = 100 + idx;
         CGFloat imageX = kCurrentScreenWidth(10) + ((kDeviceWidth - kCurrentScreenWidth(10))/3.)*idx;
         CGFloat imageY = 0;
         CGFloat imageW = ((kDeviceWidth - kCurrentScreenWidth(10))/3.) - kCurrentScreenWidth(10);
         CGFloat imageH = imageW;
         imgView.frame = CGRectMake(imageX, imageY, imageW, imageH);
         self.imgFrame = imgView.frame;
     }];
    
    // 自身
    CGFloat x = 0;
    CGFloat y = 0;
    CGFloat w = kDeviceWidth;
    CGFloat h = ((kDeviceWidth - kCurrentScreenWidth(10))/3.) - kCurrentScreenWidth(10);
    self.frame = CGRectMake(x, y, w, h);
}
@end
